-- 为lzfy_password_update_tasks表添加verify_info_id字段
USE [refunddb]
GO

-- 检查字段是否已存在
IF NOT EXISTS (SELECT * FROM sys.columns WHERE object_id = OBJECT_ID(N'[dbo].[lzfy_password_update_tasks]') AND name = 'verify_info_id')
BEGIN
    -- 添加verify_info_id字段
    ALTER TABLE [dbo].[lzfy_password_update_tasks]
    ADD [verify_info_id] int NULL;
    
    -- 添加字段注释
    EXEC sys.sp_addextendedproperty 
        @name=N'MS_Description', 
        @value=N'验证码信息ID（用于软删除指定的验证码记录）', 
        @level0type=N'SCHEMA',
        @level0name=N'dbo', 
        @level1type=N'TABLE',
        @level1name=N'lzfy_password_update_tasks', 
        @level2type=N'COLUMN',
        @level2name=N'verify_info_id';
    
    PRINT '成功添加verify_info_id字段到lzfy_password_update_tasks表';
END
ELSE
BEGIN
    PRINT 'verify_info_id字段已存在于lzfy_password_update_tasks表中';
END
GO